import java.util.Properties;

public class ProertiesHomework {
    public void proerties(){
        String url = "http://www.lovo.com/index?name=aaaaaa&age=20&gender=男";
         String str=url.substring(27,53);//截取问号后边的字符串
         String [] keyValue = str.split("&");//分割出键值对
        Properties  properties=new Properties();
        for (int i =0;i< keyValue.length;i++){//循环键值对数组
//            System.out.println(keyValue[i]);
            String[]a=keyValue[i].split("=");//再次分隔得到没对键值对的新数组
            properties.setProperty(a[0],a[1]);//将键值对赋值给properties
        }
        String name =properties.getProperty("name");//获取键的字符串
        String age =properties.getProperty("age");
        String gender =properties.getProperty("gender");
        FileUtil.soutProperties("11.properties",properties);//调用方法
        System.out.println(name+" "+age+" "+gender);

    }

    public static void main(String[] args) {
        ProertiesHomework proertiesHomework =new ProertiesHomework();
        proertiesHomework.proerties();

    }
}
